﻿using System;
using MyTinnyApi.model;
using MyTinnyApi.util;
using Newtonsoft.Json;

namespace MyTinnyApi
{
	public class AppConfig
	{
		public static string DbPath = "/Users/zhangming/Projects/MyTinnyApi/api.db3";

		public static Config GetConfig()
		{
			var dic = DbUtil.ExecutorReaderForDic<string, string>("select * from t_config", "ConfigCode", "ConfigValue");
			return JsonConvert.DeserializeObject<Config>(JsonConvert.SerializeObject(dic));
        }
	}
}

